package demo1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: WHY
 * Date: 2022-11-16
 * Time: 9:58
 */
interface IShape{


    public abstract void  draw();
    public static final String name="一宝";
     default   public    void func(){
         System.out.println("默认的");
    }

}
class Rect implements IShape{

    @Override
    public void draw() {
        System.out.println("🟥");
    }
}
class  Circle implements IShape{

    @Override
    public void draw() {
        System.out.println("○");
    }
}
class  Heart implements IShape{

    @Override
    public void draw() {
        System.out.println(";❤");
    }
}

public class Test {
    public static void darwMap(IShape shape){
        shape.draw();
    }
    public static void main(String[] args) {
        IShape shape = new Rect();
        IShape shape2 = new Circle();
        IShape shape3 = new Heart();
        shape.draw();
        shape.func();
        shape2.draw();
        shape2.func();
        shape3.draw();
        shape3.func();



    }

}
